// pages/text/text.js
const http=require('../../model/http')
Page({

  /**
   * 页面的初始数据
   */
  data: {
    start:0,
    subjects:[]
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad:async function (options) {
    var res=await http.getCatData(this.data.start)
    var subjects=res.data.subjects
    console.log(subjects)
    this.setData({
      subjects
    })
  },
  onReachBottom:async function(){
    var start=this.data.start
    start+=25
    console.log(start)
    var res=await http.getCatData(start)
    var subjects=res.data.subjects
    this.setData({
      start,
      subjects:this.data.subjects.concat(subjects)
    })
  }
})